﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
namespace Model
{
    public class BlogNews : BaseId
    {
        //nvarchar带中文比较好,默认是varchar
        [SugarColumn(ColumnDataType = "nvarchar(30)")]
        public string Title { get; set; }
        [SugarColumn(ColumnDataType = "text")]
        public string Content { get; set; }
        public DateTime Time { get; set; }
        public int ReadCount { get; set; }
        public int LikeCount { get; set; }

        public int TypeId { get; set; }
        public int WriteId { get; set; }


        //导航查询(比设置外键好，设置外键容易出问题）     
        [SugarColumn(IsIgnore = true)] //设置这个就不会映射到数据库
        public TypeInfo TypeInfo { get; set; }
        [SugarColumn(IsIgnore = true)]
        public WriterInfo WriterInfo { get; set; }
    }
}
